package com.echronos.payment.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @Author wangyadong
 * @Date 2023/11/21 15:29
 * @ClassName ChannelRotueInterfaceTypeEnums
 */
@Getter
@AllArgsConstructor
public enum ChannelRouteInterfaceTypeEnums {
    CPCN_INTERFACE("CPCN_INTERFACE", "CPCN", "中金支付接口"),
    HZPAY_INTERFACE("HZPAY_INTERFACE", "HZPAY", "华正支付接口"),
    ECHPAY_INTERFACE("ECHPAY_INTERFACE", "ECHPAY", "艾氪支付接口");

    private String interfaceCode;
    private String interfaceType;
    private String interfaceName;

    /**
     * 获取接口路由
     *
     * @param interfaceCode
     * @return
     */
    public static ChannelRouteInterfaceTypeEnums getByInterfaceCode(String interfaceCode) {
        return Arrays.stream(ChannelRouteInterfaceTypeEnums.values()).filter(r -> r.getInterfaceCode().equals(interfaceCode))
                .findFirst().orElse(null);
    }
}
